<?php

namespace Common\Model;

use Think\Model;

class OrderModel extends Model {
    
   /**
    * 后台派发司机
    * @param type $order_id
    * @param type $driver_id
    * @return boolean
    */
   public function allotDriver($order_id, $driver_id){
       if(empty($order_id)){
           return FALSE;
       }
       $data['driver_id'] = $driver_id;
       $data['order_status'] = 20; //20-运输中
       $res = $this->where(['order_id'=>$order_id,'order_status'=>10])->save($data);
       return $res;
   }
   
   /**
    * 后台审核额外费用
    * @param type $order_id
    * @param type $order_status
    * @return boolean
    */
   public function otherPriceCheck($order_id, $order_status){
       if(empty($order_id)){
           return FALSE;
       }
       $data['order_status'] = $order_status;
       $res = $this->where(['order_id'=>$order_id])->save($data);
       return $res;
   }
   
}
